eeprom16 2.2.1
Loading...
Searching...
No Matches
EEPROM 16 Click Driver

API for configuring and manipulating EEPROM 16 Click driver. More...

Topics

 EEPROM 16 Registers List
 List of registers of EEPROM 16 Click driver.
 EEPROM 16 Registers Settings
 Settings for registers of EEPROM 16 Click driver.
 EEPROM 16 MikroBUS Map
 MikroBUS pin mapping of EEPROM 16 Click driver.

Functions

void eeprom16_cfg_setup (eeprom16_cfg_t *cfg)
 EEPROM 16 configuration object setup function.
err_t eeprom16_init (eeprom16_t *ctx, eeprom16_cfg_t *cfg)
 EEPROM 16 initialization function.
err_t eeprom16_default_cfg (eeprom16_t *ctx)
 EEPROM 16 default configuration function.
err_t eeprom16_write_opcode (eeprom16_t *ctx, uint8_t opcode)
 EEPROM 16 write opcode function.
err_t eeprom16_read_opcode (eeprom16_t *ctx, uint8_t opcode, uint8_t *data_out, uint8_t len)
 EEPROM 16 read opcode function.
void eeprom16_set_wp_pin (eeprom16_t *ctx, uint8_t state)
 EEPROM 16 set WP pin function.
void eeprom16_set_hold_pin (eeprom16_t *ctx, uint8_t state)
 EEPROM 16 set HOLD pin function.
err_t eeprom16_enable_write (eeprom16_t *ctx)
 EEPROM 16 enable write function.
err_t eeprom16_disable_write (eeprom16_t *ctx)
 EEPROM 16 disable write function.
err_t eeprom16_set_block_protection (eeprom16_t *ctx, uint8_t block_protect)
 EEPROM 16 set block protection function.
err_t eeprom16_write_status (eeprom16_t *ctx, uint8_t status)
 EEPROM 16 write status function.
err_t eeprom16_read_status (eeprom16_t *ctx, uint8_t *status)
 EEPROM 16 read status function.
err_t eeprom16_memory_write (eeprom16_t *ctx, uint16_t address, uint8_t *data_in, uint8_t len)
 EEPROM 16 memory write function.
err_t eeprom16_memory_read (eeprom16_t *ctx, uint16_t address, uint8_t *data_out, uint16_t len)
 EEPROM 16 memory read function.

Detailed Description

API for configuring and manipulating EEPROM 16 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ eeprom16_cfg_setup()

void eeprom16_cfg_setup ( eeprom16_cfg_t * cfg)

EEPROM 16 configuration object setup function.

This function initializes Click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See eeprom16_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ eeprom16_default_cfg()

err_t eeprom16_default_cfg ( eeprom16_t * ctx)

EEPROM 16 default configuration function.

This function executes a default configuration of EEPROM 16 Click board.

Parameters
[in]ctx: Click context object. See eeprom16_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ eeprom16_disable_write()

err_t eeprom16_disable_write ( eeprom16_t * ctx)

EEPROM 16 disable write function.

This function disables write by issuing the WRDI command and checking the WEL bit.

Parameters
[in]ctx: Click context object. See eeprom16_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eeprom16_enable_write()

err_t eeprom16_enable_write ( eeprom16_t * ctx)

EEPROM 16 enable write function.

This function enables write by issuing the WREN command and checking the WEL bit.

Parameters
[in]ctx: Click context object. See eeprom16_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eeprom16_init()

err_t eeprom16_init ( eeprom16_t * ctx,
eeprom16_cfg_t * cfg )

EEPROM 16 initialization function.

This function initializes all necessary pins and peripherals used for this Click board.

Parameters
[out]ctx: Click context object. See eeprom16_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See eeprom16_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eeprom16_memory_read()

err_t eeprom16_memory_read ( eeprom16_t * ctx,
uint16_t address,
uint8_t * data_out,
uint16_t len )

EEPROM 16 memory read function.

This function reads a desired number of data bytes starting from the selected memory address.

Parameters
[in]ctx: Click context object. See eeprom16_t object definition for detailed explanation.
[in]address: Starting memory address [0x0000-0x0FFF].
[out]data_out: Read data output.
[in]len: Number of data bytes.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eeprom16_memory_write()

err_t eeprom16_memory_write ( eeprom16_t * ctx,
uint16_t address,
uint8_t * data_in,
uint8_t len )

EEPROM 16 memory write function.

This function writes a desired number of data bytes starting from the selected memory address.

Parameters
[in]ctx: Click context object. See eeprom16_t object definition for detailed explanation.
[in]address: Starting memory address [0x0000-0x0FFF].
[in]data_in: Data to be written.
[in]len: Number of data bytes (up to 32 bytes).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eeprom16_read_opcode()

err_t eeprom16_read_opcode ( eeprom16_t * ctx,
uint8_t opcode,
uint8_t * data_out,
uint8_t len )

EEPROM 16 read opcode function.

This function reads a desired number of data bytes from the selected opcode by using SPI serial interface.

Parameters
[in]ctx: Click context object. See eeprom16_t object definition for detailed explanation.
[in]opcode: Opcode command.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eeprom16_read_status()

err_t eeprom16_read_status ( eeprom16_t * ctx,
uint8_t * status )

EEPROM 16 read status function.

This function reads the Status register.

Parameters
[in]ctx: Click context object. See eeprom16_t object definition for detailed explanation.
[out]status: Read data output.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eeprom16_set_block_protection()

err_t eeprom16_set_block_protection ( eeprom16_t * ctx,
uint8_t block_protect )

EEPROM 16 set block protection function.

This function sets the block protection bits of the Status register.

Parameters
[in]ctx: Click context object. See eeprom16_t object definition for detailed explanation.
[in]block_protect:
  • 0x00 - None,
  • 0x04 - Upper quarter,
  • 0x08 - Upper half,
  • 0x0C - All.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eeprom16_set_hold_pin()

void eeprom16_set_hold_pin ( eeprom16_t * ctx,
uint8_t state )

EEPROM 16 set HOLD pin function.

This function sets the HOLD pin logic state.

Parameters
[in]ctx: Click context object. See eeprom16_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ eeprom16_set_wp_pin()

void eeprom16_set_wp_pin ( eeprom16_t * ctx,
uint8_t state )

EEPROM 16 set WP pin function.

This function sets the Write Protect (WP) pin logic state.

Parameters
[in]ctx: Click context object. See eeprom16_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ eeprom16_write_opcode()

err_t eeprom16_write_opcode ( eeprom16_t * ctx,
uint8_t opcode )

EEPROM 16 write opcode function.

This function writes a desired opcode command byte by using SPI serial interface.

Parameters
[in]ctx: Click context object. See eeprom16_t object definition for detailed explanation.
[in]opcode: Opcode command.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eeprom16_write_status()

err_t eeprom16_write_status ( eeprom16_t * ctx,
uint8_t status )

EEPROM 16 write status function.

This function writes a desired data to the Status register.

Parameters
[in]ctx: Click context object. See eeprom16_t object definition for detailed explanation.
[in]status: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.